package com.lkd.mapper;

import com.lkd.dto.RegionDto;
import com.lkd.entity.Node;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface NodeMapper {

    @Select("select count(*) from tb_node where region_id = #{regionId}")
    Integer countByRegionId(Long regionId);

    //条件查询
    List<Node> findList(RegionDto regionDto);

    //保存
    Boolean save(Node node);

    //更新
    Boolean update(Node node);

    //主键删除
    @Delete("delete from tb_node where id = #{id}")
    Boolean deleteById(Long id);

    @Select("select * from tb_node where id = #{id}")
    Node findById(Long id);
}
